Skip to content

Fix xview assignment through leading newaxis slices#2896

Merged
JohanMabille merged 1 commit intoxtensor-stack:masterfrom
Alex-PLACET:fix-xview-index-mapping-for-leading-newaxis-assignment
May 3, 2026
Merged

Fix xview assignment through leading newaxis slices#2896
JohanMabille merged 1 commit intoxtensor-stack:masterfrom
Alex-PLACET:fix-xview-index-mapping-for-leading-newaxis-assignment

Conversation

@Alex-PLACET
Copy link
Copy Markdown
Contributor

@Alex-PLACET Alex-PLACET commented Apr 28, 2026

Checklist

  • The title and commit message(s) are descriptive.
  • Small commits made to fix your PR have been squashed to avoid history pollution.
  • Tests have been added for new features or bug fixes.
  • API of new functions and classes are documented.

Description

This PR fixes incorrect index mapping in xview assignments when a view starts with one or more newaxis() slices.

The change updates the index computation to use a newaxis-aware slice index before applying integral-slice adjustments. That keeps writes through views with multiple leading newaxis() entries aligned with the correct element in the underlying tensor.

@Alex-PLACET
Copy link
Copy Markdown
Contributor Author

Addressing #2228

@Alex-PLACET Alex-PLACET marked this pull request as ready for review April 28, 2026 14:52
@JohanMabille JohanMabille merged commit 42d124c into xtensor-stack:master May 3, 2026
21 checks passed
@Alex-PLACET Alex-PLACET deleted the fix-xview-index-mapping-for-leading-newaxis-assignment branch May 4, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants